all:step-3 plot.pdf final.pdf

step-3:CMakeLists.txt step-3.cc
	cd build && cmake ..
	cd build && make

plot.pdf:step-3
	cd build && ./step-3 > data.txt
	cd build && mv data.txt ~/math-soft/proj
	cd build && mv solution.gpl ~/math-soft/proj
	gnuplot plot.gp

final.pdf:final.tex
	xelatex final.tex

clean:
	cd build && rm * -rf
	rm -f solution.gpl plot.pdf final.pdf data.txt *.aux *.log

.PHONY: all clean
